package com.consumer.user.controller;

import com.common.consumer.controller.AbstractConsumerGenericController;
import com.common.consumer.service.ConsumerGenericService;
import com.consumer.user.service.ConsumerRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 类描述：角色的消费者controller
 *
 * @author linzf
 */
@RestController
@RequestMapping("/role")
public class ConsumerRoleController extends AbstractConsumerGenericController {

    @Autowired
    private ConsumerRoleService consumerRoleService;

    @Override
    protected ConsumerGenericService getService() {
        return this.consumerRoleService;
    }

    /**
     * 功能描述：获取所有的菜单数据
     * @return
     */
    @PostMapping("getAllTreeAndButtonList")
    public Map<String, Object> getAllTreeAndButtonList(){
        return consumerRoleService.getAllTreeAndButtonList();
    }
}
